{% extends "blog.html" %}

{% block description %}
  <meta name="description" content="{% for tag in blog.tags %}{{ tag }}, {% endfor %}{{blog.content|striptags|truncatewords:20}}">
{% endblock %}

{% block head %}
{% endblock %}

{% block content %}
  {% include "div_blog.html" %}
  
  <div>
  {% if comments %}{{ lang.comment_all }}:{% endif %}
  {% for comment in comments %}
    <div class="BlogBlockType3">
    {{ comment.author }} {{ comment.date.date }} {{ comment.date|time:"H:i" }}
    <div class="text">{{ comment.content|removetags:"script" }}</div>

	  <div class="CommentOperation">
	  {% if comment.auth.delete %}
      <br>
	  <a class="BlogOperation" 
	    onclick="$.post('{{config.url_blog}}/comment/delete/{{ comment.key.id }}/', function(data){document.location.reload();});" 
	    href="#">{{ lang.delete }}</a>
	  {% endif %}
	
	  </div>

    </div>
  {% endfor %}
  </div>

  {% include "div_pagination.html" %}
    
  <div>
  {% if auth_comment.add %}
  <form action="{{config.url_blog}}/comment/{{ blog.key.id }}/" method="post">
    <div>
    <label for="commentdata">{{ lang.comment_add }}:</label><br>
    <textarea id="wysiwyg" class="bloginput" name="commentdata" rows="12"></textarea>
    </div>
    <div>
    <input type="submit" value="{{ lang.add }}">
    </div>
  </form>

  {% else %}
    {{ lang.comment_message }}<br><br>
  {% endif %}
  </div>
  
{% endblock %}